<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <title>Document</title>
</head>
<body>
  <script>
    var time = new Date();         //获取当前时间对象
    var y = time.getFullYear();    //获取完整的年份
    var m = time.getMonth()+1;     //这里的月份从0-11
    var d = time.getDate();        //获取天数
    var h = time.getHours();       //获取小时
    var i = time.getMinutes();     //获取分钟
    var s = time.getSeconds();     //获取秒数
    function b(num){  //对10以内的数字进行补0.前面加个字符串的0
      if(num<10){
        num = '0'+num;
      }
      return num;
    }
	
    var t = b(y)+'.'+b(m)+'.'+b(d)+'.'+b(h)+'.'+b(i)+'.'+b(s);
	
    for(var i = 0;i<t.length;i++){ //对格式化后的时间字符串进行循环
      document.write('<img src="images/'+t[i]+'.jpg">');
    }
  </script>
</body>
</html>